package com.kuzan.autocloud.common.model.workflow.runtime;

import com.kuzan.autocloud.common.model.Base;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

/**
 * <p>Description: 流程提交记录,用于流程撤回依据</p>
 *
 * @author kuzank
 */
@Data
@NoArgsConstructor
@Entity
@Table(name = "sys_workflow_run_submit_record")
public class WorkFlowRunSubmitRecord extends Base {

    @Column(length = 32)
    private String workflow;
    @Column(length = 32)
    private String runid;
    @Column(length = 32)
    private String operator;
    @Column(length = 32)
    private String begintrack;
    @Column(length = 32)
    private String endtarget;


    public static WorkFlowRunSubmitRecord of(String workflow, String runid, String begintrack, String endtarget, String operator) {
        WorkFlowRunSubmitRecord workFlowRunSubmitRecord = new WorkFlowRunSubmitRecord();
        workFlowRunSubmitRecord.setWorkflow(workflow);
        workFlowRunSubmitRecord.setRunid(runid);
        workFlowRunSubmitRecord.setBegintrack(begintrack);
        workFlowRunSubmitRecord.setEndtarget(endtarget);
        workFlowRunSubmitRecord.setOperator(operator);
        return workFlowRunSubmitRecord;
    }
}
